/**
 * 获取本地存储
 * @param key
 */
export const getLocalStorage = (key) => {
	return uni.getStorageSync(key)
}

/**
 * 设置本地存储
 * @param key
 * @param value
 * @param parseValue
 */
export const setLocalStorage = (key, value, parseValue = true) => {
	uni.setStorageSync(key, parseValue ? JSON.stringify(value) : value)
}

/**
 * 移除本地存储
 * @param key
 */
export const removeLocalStorage = (key) => {
	uni.removeStorageSync(key)
}

/**
 * 消息提示
 * @param title
 * @param icon
 * @param duration
 */
export const showMessage = (title, icon = 'none', duration = 2000) => {
	uni.showToast({title, icon, duration})
}

/**
 * 获取状态栏高度
 * @returns {number}
 */
export const getStatusBarHeight = () => {
	const systemInfo = uni.getSystemInfoSync()
	return systemInfo.statusBarHeight
}
